<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix='fmt' %>

<%--
在orderManager里多出一个列，点击查看详情
url="/render/order/getOrderItem?order_no=${Order.order_no}"，
查询该order_no的子项，展示在table里，
之后就最后列点击查看详情，即可看到评论，
下面还有一个回复框，直接写在那里，然后后台在comment里插入，
下次进来修改的时候，即可通过OrderItem.comment.comment,
ajax局部刷新--%>
<c:set var="title" value="订单子项管理"/>
<%@include file="common/adminHeader.jsp" %>
<c:set var="light" value="8"/>
<%@include file="common/adminNavigator.jsp" %>
<style>
    #tablelist span {
        height: 80px;
        line-height: 80px;
    }
    .btn-reply {
        margin-top: 26px;
        margin-right: 8px;
    }
</style>
<div class="container">
    <%--<sec:authorize access="hasRole('ADMIN')">
        <ol class="breadcrumb">
            <li><a href="javascript:void(0);">订单管理</a></li>
            &lt;%&ndash;<li>»</li>&ndash;%&gt;
            <li>详情管理</li>
        </ol>
    </sec:authorize>--%>
    <div class="right-top-box">
        <div class="btn bs-bars">
            <a class="btn-product" id="btn_add" title="添加">
                <i class="fa fa-plus fa-fw"></i>
            </a>
            <a class="btn-delete" id="btn_delete_ids" title="批量删除">
                <i class="fa fa-trash-o fa-fw"></i>
            </a>
        </div>
        <div class="row" id="tb">
            <div class="col-md-12">
                <form class="form-inline" id="resource-form">
                    <div class="group-inner">
                        <input type="text" class="form-control form-input" id="search-user_id" name="search-user_id"  placeholder="用户id">
                    </div>
                    <div class="group-inner">
                        <input type="text" class="form-control form-input" id="search-order_no" name="search-order_no" placeholder="订单号">
                    </div>
                    <div class="group-inner">
                        <input type="text" class="form-control form-input" id="search-product_name" name="search-search-product_name" placeholder="商品名字">
                    </div>
                    <a class="btn btn-info glyphicon glyphicon-search form-search group-inner" id="btnSearch" ></a>
                </form>
            </div>
        </div>
    </div>
    <div class="modal fade" id="addOrUpdateModal" tabindex="-1" role="dialog" aria-labelledby="addroleLabel" data-backdrop="static" aria-hidden="false">
        <div class="modal-backdrop fade"></div>
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title" id="addroleLabel">修改订单</h4>
                </div>
                <div class="modal-body">
                    <form id="addOrUpdateForm" class="form-horizontal form-label-left" novalidate="">
                        <input type="hidden" name="id" value="">
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="user_id">用户id<span class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" name="user_id" id="user_id" required="required" placeholder="请输入用户id">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="order_no">订单号</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" id="order_no" name="order_no" placeholder="请输入订单号">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="current_unit_price">单件价格</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" name="current_unit_price" id="current_unit_price" placeholder="请输入单件价格">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="shop_status">订单状态</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select class="form-control" name="shop_status" id="shop_status">
                                    <%--如果用户那边未付款，那么这边就是不能选择。提示用户未付款--%>
                                    <%--订单状态:0-已取消-10-未付款，20-已付款，40-已发货，50-交易成功，60-交易关闭--%>
                                    <%--如果user_status:10,那么即显示--%>
                                    <option value="10">未付款</option>
                                    <%--如果用户那边已付款，那么这边就是发货或者退钱（写明原因comment----
                                    店家修改为0时，用户修改为60，shop_status:0,user_status:60,即为原因
                                    如果shop_status:50,user_status:50,即为评价）。用户可在交易哪里查看交易关闭，原因：--%>
                                    <option value="0">退单</option>
                                    <%--
                                    如果用户只是下了订单，但是没有付款，那么用户修改为10，店家也修改10，（user_status:10，shop_status:10）

                                    如果用户取消了，那么用户修改为0时，店家也修改为60（user_status:0，shop_status:60）

                                    用户退货，那么用户修改为0时，店家也修改为60（user_status:0，shop_status:60）

                                    用户付完钱即为已付款，但是未发货，
                                    用户付款修改为20时，店家也修改为30（user_status:20，shop_status:30）

                                    如果店家点击发货，那么用户即跑到已发货哪里。（user_status:40，shop_status:40）
                                    店家修改为40时，用户也修改为40

                                    如果店家点击退单，那么用户修改为60。-----订单修改为60
                                    店家修改为0时，用户修改为60。（user_status:60，shop_status:0）

                                    用户确认收货后，用户修改为50，店家也跟着修改为50（user_status:50，shop_status:50）-----订单修改为50
                                    --%>
                                    <option value="40">发货</option>
                                    <option value="50">交易完成</option>
                                    <option value="30">未发货</option>
                                    <option value="60">交易结束</option>
                                </select>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 关闭</i></button>
                    <button type="button" class="btn btn-success addOrUpdateBtn"><i class="fa fa-save">保存</i></button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="addOrUpdateModalByComment" tabindex="-1" role="dialog" aria-labelledby="addroleLabel" data-backdrop="static" aria-hidden="false">
        <div class="modal-backdrop-comment fade"></div>
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title" id="addroleLabel">修改分类</h4>
                </div>
                <div class="modal-body">
                    <form id="addOrUpdateFormByComment" class="form-horizontal form-label-left" novalidate="">
                        <input type="hidden" name="id" id="id" value="">
                        <input type="hidden" name="parent_id" id="parent_id" value="">
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="user_name">用户名</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" name="user_name" id="user_name" readonly>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="product_id">商品id</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" id="product_id" name="product_id" readonly>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="content">评论</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" id="content" name="content">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="reply">回复</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" id="reply" name="reply" placeholder="请输入回复">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 关闭</i></button>
                    <button type="button" class="btn btn-success addOrUpdateBtnByComment"><i class="fa fa-save">保存</i></button>
                </div>
            </div>
        </div>
    </div>
    <table id="tablelist"></table>
    <script type="text/javascript" src="render/js/manager/common.js"></script>
    <script type="text/javascript" src="render/js/manager/orderitemManager.js"></script>
</div>

<%@include file="common/adminFooter.jsp" %>